Dela via


Assignments - Create Or Update

Skapa eller uppdatera en skisstilldelning.

PUT https://management.azure.com/{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}?api-version=2018-11-01-preview

URI-parametrar

Name I Obligatorisk Typ Description
assignmentName
path True

string

Namnet på skisstilldelningen.

resourceScope
path True

string

Resursens omfång. Giltiga omfång är: hanteringsgrupp (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), prenumeration (format: '/subscriptions/{subscriptionId}').

api-version
query True

string

Klient-API-version.

Begärandetext

Name Obligatorisk Typ Description
identity True

ManagedServiceIdentity

Hanterad identitet för den här skisstilldelningen.

location True

string

Platsen för den här skisstilldelningen.

properties.parameters True

<string,  ParameterValue>

Parametervärden för skisstilldelning.

properties.resourceGroups True

<string,  ResourceGroupValue>

Namn och platser för platshållare för resursgrupper.

properties.blueprintId

string

ID för den publicerade versionen av en skissdefinition.

properties.description

string

maxLength: 500

Förklara den här resursen med flera rader.

properties.displayName

string

maxLength: 256

Enradssträng förklarar den här resursen.

properties.locks

AssignmentLockSettings

Definierar hur resurser som distribueras av en skisstilldelning är låsta.

properties.scope

string

Skisstilldelningens målprenumerationsomfång (format: '/subscriptions/{subscriptionId}'). För tilldelningar på hanteringsgruppsnivå krävs egenskapen.

Svar

Name Typ Description
201 Created

Assignment

Skapad – skisstilldelning sparad.

Other Status Codes

CloudError

Felsvar för skisser.

Säkerhet

azure_auth

Azure Active Directory OAuth2 Flow

Typ: oauth2
Flow: implicit
Auktoriseringswebbadress: https://login.microsoftonline.com/common/oauth2/authorize

Omfattningar

Name Description
user_impersonation personifiera ditt användarkonto

Exempel

Assignment with system-assigned managed identity at management group scope
Assignment with system-assigned managed identity at subscription scope
Assignment with user-assigned managed identity at management group scope
Assignment with user-assigned managed identity at subscription scope

Assignment with system-assigned managed identity at management group scope

Exempelbegäran

PUT https://management.azure.com/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint?api-version=2018-11-01-preview

{
  "identity": {
    "type": "SystemAssigned"
  },
  "location": "eastus",
  "properties": {
    "description": "enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.",
    "blueprintId": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
    "scope": "subscriptions/00000000-0000-0000-0000-000000000000",
    "parameters": {
      "storageAccountType": {
        "value": "Standard_LRS"
      },
      "costCenter": {
        "value": "Contoso/Online/Shopping/Production"
      },
      "owners": {
        "value": [
          "johnDoe@contoso.com",
          "johnsteam@contoso.com"
        ]
      }
    },
    "resourceGroups": {
      "storageRG": {
        "name": "defaultRG",
        "location": "eastus"
      }
    }
  }
}

Exempelsvar

{
  "identity": {
    "type": "SystemAssigned",
    "tenantId": "00000000-0000-0000-0000-000000000000",
    "principalId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "eastus",
  "properties": {
    "description": "enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.",
    "provisioningState": "creating",
    "blueprintId": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
    "scope": "subscriptions/00000000-0000-0000-0000-000000000000",
    "parameters": {
      "storageAccountType": {
        "value": "Standard_LRS"
      },
      "costCenter": {
        "value": "Contoso/Online/Shopping/Production"
      },
      "owners": {
        "value": [
          "johnDoe@contoso.com",
          "johnsteam@contoso.com"
        ]
      }
    },
    "resourceGroups": {
      "storageRG": {
        "name": "defaultRG",
        "location": "eastus"
      }
    }
  },
  "id": "/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
  "type": "Microsoft.Blueprint/Assignment",
  "name": "assignSimpleBlueprint"
}

Assignment with system-assigned managed identity at subscription scope

Exempelbegäran

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint?api-version=2018-11-01-preview

{
  "identity": {
    "type": "SystemAssigned"
  },
  "location": "eastus",
  "properties": {
    "description": "enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.",
    "blueprintId": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
    "parameters": {
      "storageAccountType": {
        "value": "Standard_LRS"
      },
      "costCenter": {
        "value": "Contoso/Online/Shopping/Production"
      },
      "owners": {
        "value": [
          "johnDoe@contoso.com",
          "johnsteam@contoso.com"
        ]
      }
    },
    "resourceGroups": {
      "storageRG": {
        "name": "defaultRG",
        "location": "eastus"
      }
    }
  }
}

Exempelsvar

{
  "identity": {
    "type": "SystemAssigned",
    "tenantId": "00000000-0000-0000-0000-000000000000",
    "principalId": "00000000-0000-0000-0000-000000000000"
  },
  "location": "eastus",
  "properties": {
    "description": "enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.",
    "provisioningState": "creating",
    "blueprintId": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
    "parameters": {
      "storageAccountType": {
        "value": "Standard_LRS"
      },
      "costCenter": {
        "value": "Contoso/Online/Shopping/Production"
      },
      "owners": {
        "value": [
          "johnDoe@contoso.com",
          "johnsteam@contoso.com"
        ]
      }
    },
    "resourceGroups": {
      "storageRG": {
        "name": "defaultRG",
        "location": "eastus"
      }
    }
  },
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
  "type": "Microsoft.Blueprint/Assignment",
  "name": "assignSimpleBlueprint"
}

Assignment with user-assigned managed identity at management group scope

Exempelbegäran

PUT https://management.azure.com/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint?api-version=2018-11-01-preview

{
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {}
    }
  },
  "location": "eastus",
  "properties": {
    "description": "enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.",
    "blueprintId": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
    "scope": "subscriptions/00000000-0000-0000-0000-000000000000",
    "parameters": {
      "storageAccountType": {
        "value": "Standard_LRS"
      },
      "costCenter": {
        "value": "Contoso/Online/Shopping/Production"
      },
      "owners": {
        "value": [
          "johnDoe@contoso.com",
          "johnsteam@contoso.com"
        ]
      }
    },
    "resourceGroups": {
      "storageRG": {
        "name": "defaultRG",
        "location": "eastus"
      }
    }
  }
}

Exempelsvar

{
  "identity": {
    "type": "UserAssigned",
    "tenantId": "00000000-0000-0000-0000-000000000000",
    "userAssignedIdentities": {
      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {
        "principalId": "00000000-0000-0000-0000-000000000000",
        "clientId": "00000000-0000-0000-0000-000000000000"
      }
    }
  },
  "location": "eastus",
  "properties": {
    "description": "enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.",
    "provisioningState": "creating",
    "blueprintId": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
    "scope": "subscriptions/00000000-0000-0000-0000-000000000000",
    "parameters": {
      "storageAccountType": {
        "value": "Standard_LRS"
      },
      "costCenter": {
        "value": "Contoso/Online/Shopping/Production"
      },
      "owners": {
        "value": [
          "johnDoe@contoso.com",
          "johnsteam@contoso.com"
        ]
      }
    },
    "resourceGroups": {
      "storageRG": {
        "name": "defaultRG",
        "location": "eastus"
      }
    }
  },
  "id": "/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
  "type": "Microsoft.Blueprint/Assignment",
  "name": "assignSimpleBlueprint"
}

Assignment with user-assigned managed identity at subscription scope

Exempelbegäran

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint?api-version=2018-11-01-preview

{
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {}
    }
  },
  "location": "eastus",
  "properties": {
    "description": "enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.",
    "blueprintId": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
    "parameters": {
      "storageAccountType": {
        "value": "Standard_LRS"
      },
      "costCenter": {
        "value": "Contoso/Online/Shopping/Production"
      },
      "owners": {
        "value": [
          "johnDoe@contoso.com",
          "johnsteam@contoso.com"
        ]
      }
    },
    "resourceGroups": {
      "storageRG": {
        "name": "defaultRG",
        "location": "eastus"
      }
    }
  }
}

Exempelsvar

{
  "identity": {
    "type": "UserAssigned",
    "tenantId": "00000000-0000-0000-0000-000000000000",
    "userAssignedIdentities": {
      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {
        "principalId": "00000000-0000-0000-0000-000000000000",
        "clientId": "00000000-0000-0000-0000-000000000000"
      }
    }
  },
  "location": "eastus",
  "properties": {
    "description": "enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.",
    "provisioningState": "creating",
    "blueprintId": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
    "parameters": {
      "storageAccountType": {
        "value": "Standard_LRS"
      },
      "costCenter": {
        "value": "Contoso/Online/Shopping/Production"
      },
      "owners": {
        "value": [
          "johnDoe@contoso.com",
          "johnsteam@contoso.com"
        ]
      }
    },
    "resourceGroups": {
      "storageRG": {
        "name": "defaultRG",
        "location": "eastus"
      }
    }
  },
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
  "type": "Microsoft.Blueprint/Assignment",
  "name": "assignSimpleBlueprint"
}

Definitioner

Name Description
Assignment

Representerar en skisstilldelning.

AssignmentLockMode

Låsläge.

AssignmentLockSettings

Definierar hur resurser som distribueras av en skisstilldelning är låsta.

AssignmentProvisioningState

Tillstånd för skisstilldelningen.

AssignmentStatus

Status för en skisstilldelning. Det här fältet är skrivskyddat.

CloudError
ErrorAdditionalInfo

Ytterligare information om resurshanteringsfelet.

ErrorResponse

Felsvar

keyVaultReference

Anger länken till ett Nyckelvalv.

ManagedServiceIdentity

Allmänt objekt för hanterad identitet.

ManagedServiceIdentityType

Typ av hanterad identitet.

ParameterValue

Värde för den angivna parametern. Kan vara antingen "värde" eller "referens", men inte båda.

ResourceGroupValue

Representerar en Azure-resursgrupp.

SecretValueReference

Referens till en Key Vault-hemlighet.

UserAssignedIdentity

Användartilldelad hanterad identitet.

Assignment

Representerar en skisstilldelning.

Name Typ Description
id

string

Sträng-ID som används för att hitta en resurs i Azure.

identity

ManagedServiceIdentity

Hanterad identitet för den här skisstilldelningen.

location

string

Platsen för den här skisstilldelningen.

name

string

Namnet på den här resursen.

properties.blueprintId

string

ID för den publicerade versionen av en skissdefinition.

properties.description

string

maxLength: 500

Förklara den här resursen med flera rader.

properties.displayName

string

maxLength: 256

Enradssträng förklarar den här resursen.

properties.locks

AssignmentLockSettings

Definierar hur resurser som distribueras av en skisstilldelning är låsta.

properties.parameters

<string,  ParameterValue>

Parametervärden för skisstilldelning.

properties.provisioningState

AssignmentProvisioningState

Tillstånd för skisstilldelningen.

properties.resourceGroups

<string,  ResourceGroupValue>

Namn och platser för platshållare för resursgrupper.

properties.scope

string

Skisstilldelningens målprenumerationsomfång (format: '/subscriptions/{subscriptionId}'). För tilldelningar på hanteringsgruppsnivå krävs egenskapen.

properties.status

AssignmentStatus

Status för skisstilldelning. Det här fältet är skrivskyddat.

type

string

Typ av resurs.

AssignmentLockMode

Låsläge.

Värde Description
AllResourcesDoNotDelete
AllResourcesReadOnly
None

AssignmentLockSettings

Definierar hur resurser som distribueras av en skisstilldelning är låsta.

Name Typ Description
excludedActions

string[]

Lista över hanteringsåtgärder som undantas från skisslås. Upp till 200 åtgärder är tillåtna. Om låsläget är inställt på "AllResourcesReadOnly" läggs följande åtgärder automatiskt till i "excludedActions": "*/read", "Microsoft.Network/virtualNetworks/subnets/join/action" och "Microsoft.Authorization/locks/delete". Om låsläget är inställt på "AllResourcesDoNotDelete" läggs följande åtgärder automatiskt till i "excludedActions": "Microsoft.Authorization/locks/delete". Dubblettåtgärder tas bort.

excludedPrincipals

string[]

Lista över AAD-huvudnamn som undantas från skisslås. Upp till 5 huvudkonton är tillåtna.

mode

AssignmentLockMode

Låsläge.

AssignmentProvisioningState

Tillstånd för skisstilldelningen.

Värde Description
canceled
cancelling
creating
deleting
deploying
failed
locking
succeeded
validating
waiting

AssignmentStatus

Status för en skisstilldelning. Det här fältet är skrivskyddat.

Name Typ Description
lastModified

string (date-time)

Senast ändrad tid för den här skissdefinitionen.

managedResources

string[]

Lista över resurser som skapades av skisstilldelningen.

timeCreated

string (date-time)

Skapandetid för den här skissdefinitionen.

CloudError

Name Typ Description
error

ErrorResponse

Felsvar
Vanligt felsvar för alla Azure Resource Manager-API:er för att returnera felinformation för misslyckade åtgärder. (Detta följer även formatet för OData-felsvar.)

ErrorAdditionalInfo

Ytterligare information om resurshanteringsfelet.

Name Typ Description
info

object

Ytterligare information.

type

string

Ytterligare informationstyp.

ErrorResponse

Felsvar

Name Typ Description
additionalInfo

ErrorAdditionalInfo[]

Ytterligare information om felet.

code

string

Felkoden.

details

ErrorResponse[]

Felinformationen.

message

string

Felmeddelandet.

target

string

Felmålet.

keyVaultReference

Anger länken till ett Nyckelvalv.

Name Typ Description
id

string

Azure-resurs-ID för Key Vault.

ManagedServiceIdentity

Allmänt objekt för hanterad identitet.

Name Typ Description
principalId

string

Huvud-ID för Azure Active Directory som är associerat med den här identiteten.

tenantId

string

ID för Azure Active Directory.

type

ManagedServiceIdentityType

Typ av hanterad identitet.

userAssignedIdentities

<string,  UserAssignedIdentity>

Listan över användartilldelade hanterade identiteter som är associerade med resursen. Nyckeln är Azure-resurs-ID för den hanterade identiteten.

ManagedServiceIdentityType

Typ av hanterad identitet.

Värde Description
None
SystemAssigned
UserAssigned

ParameterValue

Värde för den angivna parametern. Kan vara antingen "värde" eller "referens", men inte båda.

Name Typ Description
reference

SecretValueReference

Parametervärde som referenstyp.

value

object

Parametervärde. Alla giltiga JSON-värden tillåts, inklusive objekt, matriser, strängar, tal och booleska värden.

ResourceGroupValue

Representerar en Azure-resursgrupp.

Name Typ Description
location

string

Plats för resursgruppen.

name

string

minLength: 1
maxLength: 90

Namnet på resursgruppen.

SecretValueReference

Referens till en Key Vault-hemlighet.

Name Typ Description
keyVault

keyVaultReference

Anger referensen till ett visst Azure Key Vault.

secretName

string

Namnet på hemligheten.

secretVersion

string

Den version av hemligheten som ska användas. Om den lämnas tom används den senaste versionen av hemligheten.

UserAssignedIdentity

Användartilldelad hanterad identitet.

Name Typ Description
clientId

string

Klientapp-ID som är associerat med den här identiteten.

principalId

string

Huvud-ID för Azure Active Directory som är associerat med den här identiteten.