POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default/joinRequests/{joinRequestName}/deny?api-version=2021-12-01-preview
import com.azure.core.util.Context;
/** Samples for JoinRequests Deny. */
public final class Main {
/*
* x-ms-original-file: specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/JoinRequestApproveAndDeny.json
*/
/**
* Sample code: JoinRequestDeny.
*
* @param manager Entry point to EducationManager.
*/
public static void joinRequestDeny(com.azure.resourcemanager.education.EducationManager manager) {
manager
.joinRequests()
.denyWithResponse(
"{billingAccountName}",
"{billingProfileName}",
"{invoiceSectionName}",
"{joinRequestName}",
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.education import EducationManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-education
# USAGE
python join_request_approve_and_deny.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EducationManagementClient(
credential=DefaultAzureCredential(),
)
response = client.join_requests.approve(
billing_account_name="{billingAccountName}",
billing_profile_name="{billingProfileName}",
invoice_section_name="{invoiceSectionName}",
join_request_name="{joinRequestName}",
)
print(response)
# x-ms-original-file: specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/JoinRequestApproveAndDeny.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeducation_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/education/armeducation"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/JoinRequestApproveAndDeny.json
func ExampleJoinRequestsClient_Approve() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeducation.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewJoinRequestsClient().Approve(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", "{joinRequestName}", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EducationManagementClient } = require("@azure/arm-education");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deny student joining the redeemable lab
*
* @summary Deny student joining the redeemable lab
* x-ms-original-file: specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/JoinRequestApproveAndDeny.json
*/
async function joinRequestDeny() {
const billingAccountName = "{billingAccountName}";
const billingProfileName = "{billingProfileName}";
const invoiceSectionName = "{invoiceSectionName}";
const joinRequestName = "{joinRequestName}";
const credential = new DefaultAzureCredential();
const client = new EducationManagementClient(credential);
const result = await client.joinRequests.deny(
billingAccountName,
billingProfileName,
invoiceSectionName,
joinRequestName
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue