는 가상 머신에 할당 해제 된 가상 머신을
Virtual Machines REST API 목록 작업을 시작하는 푸른 관리 API를 호출합니다. 가상 컴퓨터를 시작하려면, 당신은 this API을 시도 할 수 있습니다 : 나는 API 메서드 매개 변수 (예를 들어, 구독 ID, 자원 ID 등)에 대한 값을 얻을 수 있습니다
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vm}/start?api-version={apiVersion}
.
Azure 포털에서 {subscriptionId}
과 { resourceGroup}
을 찾을 수 있습니다.
![enter image description here](https://i.stack.imgur.com/y35bp.png)
어떻게 당신은
this article이 푸른 REST 운영 및 요청 인증을 시작 확인할 수 있습니다 권한
처리합니다. 그리고 다음 코드를 참조하여 액세스 토큰을 얻을 수 있습니다.
string tenantId = "{tenantId}";
string clientId = "{clientId}";
string clientSecret = "{secret}";
string subscriptionid = "{subscriptionid}";
string authContextURL = "https://login.windows.net/" + tenantId;
var authenticationContext = new AuthenticationContext(authContextURL);
var credential = new ClientCredential(clientId, clientSecret);
var result = await authenticationContext.AcquireTokenAsync(resource: "https://management.azure.com/", clientCredential: credential);
if (result == null)
{
throw new InvalidOperationException("Failed to obtain the JWT token");
}
string token = result.AccessToken;
이외에도이 기사에서는 create AD application and service principal that can access resources에 대한 설명을 참조하십시오.
달성하려는 목표에 대해 자세히 추가하십시오. 올리려고하는 링크가 작동하지 않습니다. –