Skip to content

Commit

Permalink
[AutoRelease] t2-msi-2023-02-16-74257(can only be merged by SDK owner) (
Browse files Browse the repository at this point in the history
#28846)

* code and test

* update version

---------

Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <[email protected]>
  • Loading branch information
azure-sdk and Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) authored Feb 16, 2023
1 parent c70a602 commit a991d82
Show file tree
Hide file tree
Showing 39 changed files with 559 additions and 52 deletions.
7 changes: 7 additions & 0 deletions sdk/resources/azure-mgmt-msi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release History

## 7.1.0b1 (2023-02-16)

### Other Changes

- Added generated samples in github repo
- Drop support for python<3.7.0

## 7.0.0 (2023-02-02)

### Features Added
Expand Down
6 changes: 3 additions & 3 deletions sdk/resources/azure-mgmt-msi/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "3d7a3848106b831a4a7f46976fe38aa605c4f44d",
"commit": "51d4c24a011e300b9713179e0515fef35bf3f678",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.2.16",
"@autorest/python@6.4.0",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/msi/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.16 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/msi/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.0 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/msi/resource-manager/readme.md"
}
2 changes: 1 addition & 1 deletion sdk/resources/azure-mgmt-msi/azure/mgmt/msi/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "7.0.0"
VERSION = "7.1.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ def __enter__(self) -> "ManagedServiceIdentityClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details) -> None:
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "7.0.0"
VERSION = "7.1.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ async def __aenter__(self) -> "ManagedServiceIdentityClient":
await self._client.__aenter__()
return self

async def __aexit__(self, *exc_details) -> None:
async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ async def create_or_update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to create or update the identity. Is either a model type or a IO
type. Required.
:param parameters: Parameters to create or update the identity. Is either a Identity type or a
IO type. Required.
:type parameters: ~azure.mgmt.msi.v2018_11_30.models.Identity or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down Expand Up @@ -439,8 +439,8 @@ async def update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to update the identity. Is either a model type or a IO type.
Required.
:param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO
type. Required.
:type parameters: ~azure.mgmt.msi.v2018_11_30.models.IdentityUpdate or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ def create_or_update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to create or update the identity. Is either a model type or a IO
type. Required.
:param parameters: Parameters to create or update the identity. Is either a Identity type or a
IO type. Required.
:type parameters: ~azure.mgmt.msi.v2018_11_30.models.Identity or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down Expand Up @@ -616,8 +616,8 @@ def update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to update the identity. Is either a model type or a IO type.
Required.
:param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO
type. Required.
:type parameters: ~azure.mgmt.msi.v2018_11_30.models.IdentityUpdate or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ def __enter__(self) -> "ManagedServiceIdentityClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details) -> None:
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "7.0.0"
VERSION = "7.1.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ async def __aenter__(self) -> "ManagedServiceIdentityClient":
await self._client.__aenter__()
return self

async def __aexit__(self, *exc_details) -> None:
async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ async def create_or_update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to create or update the identity. Is either a model type or a IO
type. Required.
:param parameters: Parameters to create or update the identity. Is either a Identity type or a
IO type. Required.
:type parameters: ~azure.mgmt.msi.v2021_09_30_preview.models.Identity or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down Expand Up @@ -567,8 +567,8 @@ async def update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to update the identity. Is either a model type or a IO type.
Required.
:param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO
type. Required.
:type parameters: ~azure.mgmt.msi.v2021_09_30_preview.models.IdentityUpdate or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ def create_or_update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to create or update the identity. Is either a model type or a IO
type. Required.
:param parameters: Parameters to create or update the identity. Is either a Identity type or a
IO type. Required.
:type parameters: ~azure.mgmt.msi.v2021_09_30_preview.models.Identity or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down Expand Up @@ -804,8 +804,8 @@ def update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to update the identity. Is either a model type or a IO type.
Required.
:param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO
type. Required.
:type parameters: ~azure.mgmt.msi.v2021_09_30_preview.models.IdentityUpdate or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ def __enter__(self) -> "ManagedServiceIdentityClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details) -> None:
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "7.0.0"
VERSION = "7.1.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ async def __aenter__(self) -> "ManagedServiceIdentityClient":
await self._client.__aenter__()
return self

async def __aexit__(self, *exc_details) -> None:
async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ async def create_or_update(
credential resource. Required.
:type federated_identity_credential_resource_name: str
:param parameters: Parameters to create or update the federated identity credential. Is either
a model type or a IO type. Required.
a FederatedIdentityCredential type or a IO type. Required.
:type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.FederatedIdentityCredential or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ async def create_or_update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to create or update the identity. Is either a model type or a IO
type. Required.
:param parameters: Parameters to create or update the identity. Is either a Identity type or a
IO type. Required.
:type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.Identity or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down Expand Up @@ -567,8 +567,8 @@ async def update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to update the identity. Is either a model type or a IO type.
Required.
:param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO
type. Required.
:type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.IdentityUpdate or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def create_or_update(
credential resource. Required.
:type federated_identity_credential_resource_name: str
:param parameters: Parameters to create or update the federated identity credential. Is either
a model type or a IO type. Required.
a FederatedIdentityCredential type or a IO type. Required.
:type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.FederatedIdentityCredential or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ def create_or_update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to create or update the identity. Is either a model type or a IO
type. Required.
:param parameters: Parameters to create or update the identity. Is either a Identity type or a
IO type. Required.
:type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.Identity or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down Expand Up @@ -804,8 +804,8 @@ def update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to update the identity. Is either a model type or a IO type.
Required.
:param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO
type. Required.
:type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.IdentityUpdate or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ def __enter__(self) -> "ManagedServiceIdentityClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details) -> None:
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "7.0.0"
VERSION = "7.1.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ async def __aenter__(self) -> "ManagedServiceIdentityClient":
await self._client.__aenter__()
return self

async def __aexit__(self, *exc_details) -> None:
async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ async def create_or_update(
credential resource. Required.
:type federated_identity_credential_resource_name: str
:param parameters: Parameters to create or update the federated identity credential. Is either
a model type or a IO type. Required.
a FederatedIdentityCredential type or a IO type. Required.
:type parameters: ~azure.mgmt.msi.v2023_01_31.models.FederatedIdentityCredential or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ async def create_or_update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to create or update the identity. Is either a model type or a IO
type. Required.
:param parameters: Parameters to create or update the identity. Is either a Identity type or a
IO type. Required.
:type parameters: ~azure.mgmt.msi.v2023_01_31.models.Identity or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down Expand Up @@ -439,8 +439,8 @@ async def update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to update the identity. Is either a model type or a IO type.
Required.
:param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO
type. Required.
:type parameters: ~azure.mgmt.msi.v2023_01_31.models.IdentityUpdate or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def create_or_update(
credential resource. Required.
:type federated_identity_credential_resource_name: str
:param parameters: Parameters to create or update the federated identity credential. Is either
a model type or a IO type. Required.
a FederatedIdentityCredential type or a IO type. Required.
:type parameters: ~azure.mgmt.msi.v2023_01_31.models.FederatedIdentityCredential or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ def create_or_update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to create or update the identity. Is either a model type or a IO
type. Required.
:param parameters: Parameters to create or update the identity. Is either a Identity type or a
IO type. Required.
:type parameters: ~azure.mgmt.msi.v2023_01_31.models.Identity or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down Expand Up @@ -616,8 +616,8 @@ def update(
:type resource_group_name: str
:param resource_name: The name of the identity resource. Required.
:type resource_name: str
:param parameters: Parameters to update the identity. Is either a model type or a IO type.
Required.
:param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO
type. Required.
:type parameters: ~azure.mgmt.msi.v2023_01_31.models.IdentityUpdate or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.identity import DefaultAzureCredential
from azure.mgmt.msi import ManagedServiceIdentityClient

"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-msi
# USAGE
python federated_identity_credential_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""


def main():
client = ManagedServiceIdentityClient(
credential=DefaultAzureCredential(),
subscription_id="c267c0e7-0a73-4789-9e17-d26aeb0904e5",
)

response = client.federated_identity_credentials.create_or_update(
resource_group_name="rgName",
resource_name="resourceName",
federated_identity_credential_resource_name="ficResourceName",
parameters={
"properties": {
"audiences": ["api://AzureADTokenExchange"],
"issuer": "https://oidc.prod-aks.azure.com/TenantGUID/IssuerGUID",
"subject": "system:serviceaccount:ns:svcaccount",
}
},
)
print(response)


# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/FederatedIdentityCredentialCreate.json
if __name__ == "__main__":
main()
Loading

0 comments on commit a991d82

Please sign in to comment.