Get a blueprint assignment operation.
GET https://management.azure.com/{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}/assignmentOperations/{assignmentOperationName}?api-version=2018-11-01-preview
URI Parameters
Name |
In |
Required |
Type |
Description |
assignmentName
|
path |
True
|
string
|
Name of the blueprint assignment.
|
assignmentOperationName
|
path |
True
|
string
|
Name of the blueprint assignment operation.
|
resourceScope
|
path |
True
|
string
|
The scope of the resource. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}').
|
api-version
|
query |
True
|
string
|
Client API Version.
|
Responses
Name |
Type |
Description |
200 OK
|
AssignmentOperation
|
OK -- blueprint assignment operation retrieved.
|
Other Status Codes
|
CloudError
|
Blueprints error response.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
Assignment at management group scope
Sample Request
GET https://management.azure.com/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f?api-version=2018-11-01-preview
package armblueprint_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/blueprint/armblueprint"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPAssignment/BlueprintAssignmentOperation_Get.json
func ExampleAssignmentOperationsClient_Get_assignmentAtManagementGroupScope() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armblueprint.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAssignmentOperationsClient().Get(ctx, "managementGroups/ContosoOnlineGroup", "assignSimpleBlueprint", "fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AssignmentOperation = armblueprint.AssignmentOperation{
// Name: to.Ptr("fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f"),
// Type: to.Ptr("microsoft.blueprint/blueprintAssignments/operations"),
// ID: to.Ptr("/managementGroups/ContosoOnlineGroup/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f"),
// Properties: &armblueprint.AssignmentOperationProperties{
// AssignmentState: to.Ptr("succeed"),
// BlueprintVersion: to.Ptr("v20181101"),
// Deployments: []*armblueprint.AssignmentDeploymentJob{
// {
// Action: to.Ptr("put"),
// History: []*armblueprint.AssignmentDeploymentJobResult{
// {
// Error: &armblueprint.AzureResourceManagerError{
// Code: to.Ptr("dummy"),
// Message: to.Ptr("dummy"),
// },
// }},
// JobState: to.Ptr("succeeded"),
// Kind: to.Ptr("azureResource"),
// RequestURI: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e"),
// Result: &armblueprint.AssignmentDeploymentJobResult{
// Resources: []*armblueprint.AssignmentJobCreatedResource{
// {
// Name: to.Ptr("foobar"),
// Type: to.Ptr("foo/bar"),
// ID: to.Ptr("blabla"),
// }},
// },
// }},
// TimeCreated: to.Ptr("2018-11-13T15:19:45-08:00"),
// TimeFinished: to.Ptr("2018-11-13T15:26:02-08:00"),
// TimeStarted: to.Ptr("2018-11-13T15:21:49-08:00"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPAssignment/BlueprintAssignmentOperation_Get.json
// this example is just showing the usage of "AssignmentOperations_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this AssignmentResource created on azure
// for more information of creating AssignmentResource, please refer to the document of AssignmentResource
string resourceScope = "managementGroups/ContosoOnlineGroup";
string assignmentName = "assignSimpleBlueprint";
ResourceIdentifier assignmentResourceId = AssignmentResource.CreateResourceIdentifier(resourceScope, assignmentName);
AssignmentResource assignment = client.GetAssignmentResource(assignmentResourceId);
// get the collection of this AssignmentOperationResource
AssignmentOperationCollection collection = assignment.GetAssignmentOperations();
// invoke the operation
string assignmentOperationName = "fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f";
NullableResponse<AssignmentOperationResource> response = await collection.GetIfExistsAsync(assignmentOperationName);
AssignmentOperationResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
AssignmentOperationData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/managementGroups/ContosoOnlineGroup/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"type": "microsoft.blueprint/blueprintAssignments/operations",
"name": "fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"properties": {
"blueprintVersion": "v20181101",
"assignmentState": "succeed",
"timeCreated": "2018-11-13T15:19:45-08:00",
"timeStarted": "2018-11-13T15:21:49-08:00",
"timeFinished": "2018-11-13T15:26:02-08:00",
"deployments": [
{
"kind": "azureResource",
"action": "put",
"jobState": "succeeded",
"requestUri": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e",
"result": {
"resources": [
{
"id": "blabla",
"name": "foobar",
"type": "foo/bar"
}
]
},
"history": [
{
"error": {
"code": "dummy",
"message": "dummy"
}
}
]
}
]
}
}
Assignment at subscription scope
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f?api-version=2018-11-01-preview
package armblueprint_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/blueprint/armblueprint"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPAssignment/BlueprintAssignmentOperation_Get.json
func ExampleAssignmentOperationsClient_Get_assignmentAtSubscriptionScope() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armblueprint.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAssignmentOperationsClient().Get(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "assignSimpleBlueprint", "fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AssignmentOperation = armblueprint.AssignmentOperation{
// Name: to.Ptr("fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f"),
// Type: to.Ptr("microsoft.blueprint/blueprintAssignments/operations"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f"),
// Properties: &armblueprint.AssignmentOperationProperties{
// AssignmentState: to.Ptr("succeed"),
// BlueprintVersion: to.Ptr("v20181101"),
// Deployments: []*armblueprint.AssignmentDeploymentJob{
// {
// Action: to.Ptr("put"),
// History: []*armblueprint.AssignmentDeploymentJobResult{
// {
// Error: &armblueprint.AzureResourceManagerError{
// Code: to.Ptr("dummy"),
// Message: to.Ptr("dummy"),
// },
// }},
// JobState: to.Ptr("succeeded"),
// Kind: to.Ptr("azureResource"),
// RequestURI: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e"),
// Result: &armblueprint.AssignmentDeploymentJobResult{
// Resources: []*armblueprint.AssignmentJobCreatedResource{
// {
// Name: to.Ptr("foobar"),
// Type: to.Ptr("foo/bar"),
// ID: to.Ptr("blabla"),
// }},
// },
// }},
// TimeCreated: to.Ptr("2018-11-13T15:19:45-08:00"),
// TimeFinished: to.Ptr("2018-11-13T15:26:02-08:00"),
// TimeStarted: to.Ptr("2018-11-13T15:21:49-08:00"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPAssignment/BlueprintAssignmentOperation_Get.json
// this example is just showing the usage of "AssignmentOperations_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this AssignmentResource created on azure
// for more information of creating AssignmentResource, please refer to the document of AssignmentResource
string resourceScope = "subscriptions/00000000-0000-0000-0000-000000000000";
string assignmentName = "assignSimpleBlueprint";
ResourceIdentifier assignmentResourceId = AssignmentResource.CreateResourceIdentifier(resourceScope, assignmentName);
AssignmentResource assignment = client.GetAssignmentResource(assignmentResourceId);
// get the collection of this AssignmentOperationResource
AssignmentOperationCollection collection = assignment.GetAssignmentOperations();
// invoke the operation
string assignmentOperationName = "fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f";
NullableResponse<AssignmentOperationResource> response = await collection.GetIfExistsAsync(assignmentOperationName);
AssignmentOperationResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
AssignmentOperationData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"type": "microsoft.blueprint/blueprintAssignments/operations",
"name": "fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"properties": {
"blueprintVersion": "v20181101",
"assignmentState": "succeed",
"timeCreated": "2018-11-13T15:19:45-08:00",
"timeStarted": "2018-11-13T15:21:49-08:00",
"timeFinished": "2018-11-13T15:26:02-08:00",
"deployments": [
{
"kind": "azureResource",
"action": "put",
"jobState": "succeeded",
"requestUri": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e",
"result": {
"resources": [
{
"id": "blabla",
"name": "foobar",
"type": "foo/bar"
}
]
},
"history": [
{
"error": {
"code": "dummy",
"message": "dummy"
}
}
]
}
]
}
}
Definitions
AssignmentDeploymentJob
Represents individual job in given blueprint assignment operation.
Name |
Type |
Description |
action
|
string
|
Name of the action performed in this job.
|
history
|
AssignmentDeploymentJobResult[]
|
Result of this deployment job for each retry.
|
jobId
|
string
|
Id of this job.
|
jobState
|
string
|
State of this job.
|
kind
|
string
|
Kind of job.
|
requestUri
|
string
|
Reference to deployment job resource id.
|
result
|
AssignmentDeploymentJobResult
|
Deployment job result.
|
AssignmentDeploymentJobResult
Result of each individual deployment in a blueprint assignment.
AssignmentJobCreatedResource
Azure resource created from deployment job.
Name |
Type |
Description |
id
|
string
|
String Id used to locate any resource on Azure.
|
name
|
string
|
Name of this resource.
|
properties
|
object
|
Additional properties in a dictionary.
|
type
|
string
|
Type of this resource.
|
AssignmentOperation
Represents underlying deployment detail for each update to the blueprint assignment.
Name |
Type |
Description |
id
|
string
|
String Id used to locate any resource on Azure.
|
name
|
string
|
Name of this resource.
|
properties.assignmentState
|
string
|
State of this blueprint assignment operation.
|
properties.blueprintVersion
|
string
|
The published version of the blueprint definition used for the blueprint assignment operation.
|
properties.deployments
|
AssignmentDeploymentJob[]
|
List of jobs in this blueprint assignment operation.
|
properties.timeCreated
|
string
|
Create time of this blueprint assignment operation.
|
properties.timeFinished
|
string
|
Finish time of the overall underlying deployments.
|
properties.timeStarted
|
string
|
Start time of the underlying deployment.
|
type
|
string
|
Type of this resource.
|
AzureResourceManagerError
Error code and message
Name |
Type |
Description |
code
|
string
|
Error code.
|
message
|
string
|
Error message.
|
CloudError
Name |
Type |
Description |
error
|
ErrorResponse
|
Error Response
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)
|
ErrorAdditionalInfo
The resource management error additional info.
Name |
Type |
Description |
info
|
object
|
The additional info.
|
type
|
string
|
The additional info type.
|
ErrorResponse
Error Response
Name |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
code
|
string
|
The error code.
|
details
|
ErrorResponse[]
|
The error details.
|
message
|
string
|
The error message.
|
target
|
string
|
The error target.
|