Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added listServicePrincipalId #17068

Merged
merged 23 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from 17 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,55 @@
"application/json"
]
}
},
ikanni marked this conversation as resolved.
Show resolved Hide resolved
"/subscriptions/{subscriptionId}/providers/Microsoft.Automanage/servicePrincipals/{servicePrincipalName}": {
"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"
},
{
"name": "servicePrincipalName",
"in": "path",
"required": true,
"type": "string",
"description": "Name of the servicePrincipal Name. Only default is supported."
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
ikanni marked this conversation as resolved.
Show resolved Hide resolved
"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 +1660,49 @@
"description": "Error message, if any, returned when deploying the resource."
}
}
},
"ServicePrincipal": {
"description": "The Service Principal Id for the subscription.",
"type": "object",
"properties": {
"id": {
"type": "string",
"readOnly": true,
"description": "ARM id of the resource."
},
"name": {
"type": "string",
"readOnly": true,
"description": "Name of the resource."
},
"type": {
"type": "string",
"readOnly": true,
"description": "Type of the resource."
},
"properties": {
"title": "Properties",
"x-ms-client-flatten": true,
"$ref": "#/definitions/ServicePrincipalProperties",
"description": "The Service Principal properties for the subscription"
}
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.

}
},
"ServicePrincipalProperties": {
"description": "The Service Principal properties for the subscription.",
"type": "object",
"properties": {
"servicePrincipalId": {
ikanni marked this conversation as resolved.
Show resolved Hide resolved
"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,21 @@
{
"parameters": {
"subscriptionId": "mySubscriptionId",
"servicePrincipalName": "default",
"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
}
}
}
}
}
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