Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,93 @@
"application/json"
]
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Automanage/servicePrincipals": {
"get": {
"tags": [
"servicePrincipals"
],
"operationId": "ServicePrincipals_ListBySubscription",
"description": "Get the Automanage AAD first party Application Service Principal details for the subscription id.",
"x-ms-examples": {
"List service principal by subscription": {
"$ref": "./examples/listServicePrincipalBySubscription.json"
}
},
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Returns the Automanage ADD first party Application Service Principal details for the subscription.",
"schema": {
"$ref": "#/definitions/ServicePrincipalListResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": null
},
"produces": [
"application/json"
],
"consumes": [
"application/json"
]
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Automanage/servicePrincipals/default": {
"get": {
"tags": [
"servicePrincipals"
],
"operationId": "ServicePrincipals_Get",
"description": "Get the Automanage AAD first party Application Service Principal details for the subscription id.",
"x-ms-examples": {
"Get service principal": {
"$ref": "./examples/getServicePrincipal.json"
}
},
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Returns the Automanage ADD first party Application Service Principal details for the subscription.",
"schema": {
"$ref": "#/definitions/ServicePrincipal"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
},
"produces": [
"application/json"
],
"consumes": [
"application/json"
]
}
}
},
"definitions": {
Expand Down Expand Up @@ -1611,6 +1698,57 @@
"description": "Error message, if any, returned when deploying the resource."
}
}
},
"ServicePrincipalListResult": {
"description": "The list of ServicePrincipals.",
"type": "object",
"properties": {
"value": {
"description": "The list of servicePrincipals.",
"type": "array",
"items": {
"$ref": "#/definitions/ServicePrincipal"
}
}
}
},
"ServicePrincipal": {
"description": "The Service Principal Id for the subscription.",
"type": "object",
"properties": {
"properties": {
"title": "Properties",
"x-ms-client-flatten": true,
"$ref": "#/definitions/ServicePrincipalProperties",
"description": "The Service Principal properties for the subscription"
},
"systemData": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData",
"readOnly": true,
"description": "Azure Resource Manager metadata containing createdBy and modifiedBy information."
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be a proxy resource

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is a Proxy resource. We have updated in Manifest

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No like reference a ProxyResource object. For example you can see how other swaggers reference : https://github.com/Azure/azure-rest-api-specs-pr/blob/main/specification/common-types/resource-management/v3/types.json#L91

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you got it! I will fix it now

Copy link
Contributor Author

@ikanni ikanni Feb 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raosuhas When I reference ProxyResource, I got the below error for RequiredReadOnlySystemData
Since we are doing get only, Can we return systemData.createdBy as SYSTEM and systemData.createdAt as "0001-01-01T00:00:00.00Z" ?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raosuhas Above comment is fixed and I will resolve once you answer for the above question.

},
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ProxyResource"
}
]
},
"ServicePrincipalProperties": {
"description": "The Service Principal properties for the subscription.",
"type": "object",
"properties": {
"servicePrincipalId": {
"type": "string",
"readOnly": true,
"description": "The Service Principal Id for the subscription."
},
"authorizationSet": {
"type": "boolean",
"readOnly": true,
"description": "Returns the contributor RBAC Role exist or not for the Service Principal Id."
}
}
}
},
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"parameters": {
"subscriptionId": "mySubscriptionId",
"api-version": "2021-04-30-preview"
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/subscriptions/subscriptionId/providers/Microsoft.Automanage/servicePrincipals/default",
"name": "default",
"type": "Microsoft.Automanage/ConfigurationProfileAssignments",
"properties": {
"servicePrincipalId": "<servicePrincipalId>",
"authorizationSet": true
},
"systemData": {
"createdBy": "SYSTEM",
"createdByType": "User",
"createdAt": "0001-01-01T00:00:00.00Z",
"lastModifiedBy": "SYSTEM",
"lastModifiedByType": "User",
"lastModifiedAt": "0001-01-01T00:00:00.00Z"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@
"operation": "Microsoft.Automanage/configurationProfileAssignments/reports/read",
"description": "Get report for configuration profile assignment."
}
},
{
"name": "Microsoft.Automanage/servicePrincipals/read",
"display": {
"provider": "Microsoft Automanage",
"resource": "Microsoft.Automanage/servicePrincipals",
"operation": "Microsoft.Automanage/servicePrincipals/read",
"description": "Read the Automanage AAD first party service principal id and authorizationSet for the subscription. This service principal id is used to grant the Contributor RBAC permission to Automanage AAD first party Application."
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parameters": {
"subscriptionId": "mySubscriptionId",
"api-version": "2021-04-30-preview"
},
"responses": {
"200": {
"headers": {},
"body": {
"value": [
{
"id": "/subscriptions/subscriptionId/providers/Microsoft.Automanage/servicePrincipals/default",
"name": "default",
"type": "Microsoft.Automanage/ConfigurationProfileAssignments",
"properties": {
"servicePrincipalId": "<servicePrincipalId>",
"authorizationSet": true
},
"systemData": {
"createdBy": "SYSTEM",
"createdByType": "User",
"createdAt": "0001-01-01T00:00:00.00Z",
"lastModifiedBy": "SYSTEM",
"lastModifiedByType": "User",
"lastModifiedAt": "0001-01-01T00:00:00.00Z"
}
}
]
}
}
}
}