%3CLINGO-SUB%20id%3D%22lingo-sub-1560999%22%20slang%3D%22en-US%22%3ERe%3A%20Usage%20of%20Custom%20RBAC%20roles%20in%20Azure%20API%20Management%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1560999%22%20slang%3D%22en-US%22%3E%3CP%3EGreat%20blogpost%20!%20Thanks%20for%20Sharing%20with%20the%20Community%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fhtml%2Fimages%2Femoticons%2Fcool_40x40.gif%22%20alt%3D%22%3Acool%3A%22%20title%3D%22%3Acool%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1624479%22%20slang%3D%22en-US%22%3ERe%3A%20Usage%20of%20Custom%20RBAC%20roles%20in%20Azure%20API%20Management%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1624479%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3C%2FP%3E%3CP%3ELooks%20like%20something%20has%20been%20changed%20recently%20as%20you%20mentioned%20in%20step%208.%3C%2FP%3E%3CP%3EScenario%202%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-paas-developer-blog%2Fusage-of-custom-rbac-roles-in-azure-api-management%2Fba-p%2F1560571%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-paas-developer-blog%2Fusage-of-custom-rbac-roles-in-azure-api-management%2Fba-p%2F1560571%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%22%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20ability%20to%20read%20subscription%20keys%20from%20products%20(an%20action%20which%20is%20defined%20as%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EMicrosoft.ApiManagement%2Fservice%2Fproducts%2Fsubscriptions%2Fread%3C%2FSTRONG%3E%3CSPAN%3E)%20is%20allowed%20by%20default%20for%20users%20having%20the%20'API%20Management%20Service%20Reader%20Role'.%20Same%20is%20the%20case%20for%20navigating%20to%20the%20keys%20via%20APIs%2Fsubscriptions.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%22%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20API%20Management%20Service%20Reader%20Role'%20use%20to%20allow%20to%20view%20the%20API%20subscriptions%20of%20products%20%2C%20however%20from%20august%2020%20this%20feature%20is%20not%20available%20or%20some%20updates%20happend%20with%20new%20developer%20portal%20updates%20.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EWe%20had%20an%20user%20in%20our%20environment%20with%26nbsp%3BAPI%20Management%20Service%20Reader%20Role'%20access%20to%20APIM%20and%20he%20was%20able%20to%20view%20the%20subscription%20keys%20.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ENow%20all%20of%20sudden%20without%20any%20changes%20to%20permission%20he%20is%20not%20able%20view%20the%20keys%20and%20he%20can%20not%20perform%20the%20API%20call%20test%20from%20the%20APIM%20portal.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWould%20you%20be%20able%20to%20confirm%20%2C%20if%20there%20any%20changes%20happend%20recently%20from%20MS%20.%20which%20could%20have%20triggered%20API%20subscription%20key%20access.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1634545%22%20slang%3D%22en-US%22%3ERe%3A%20Usage%20of%20Custom%20RBAC%20roles%20in%20Azure%20API%20Management%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1634545%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F145193%22%20target%3D%22_blank%22%3E%40Jagan%20CR%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20comment!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYes%2C%20this%20has%20been%20a%20recent%20design%20change.%20The%20Azure%20Portal%20has%20been%20upgraded%20to%20use%20API%20Version%202019-12-01.%3C%2FP%3E%0A%3CP%3EWith%20this%20change%2C%20APIM%20users%20having%20the%20'API%20Management%20Service%20Reader%20Role'%20would%20no%20longer%20be%20able%20to%20read%20subscription%20keys.%20Neither%20would%20the%20subscription%20keys%20be%20automatically%20added%20while%20performing%20sample%20API%20calls%20from%20within%20the%20Test%20console%20of%20the%20APIM%20service%20for%20users%20having%20this%20role%20(Users%20with%20the%20%E2%80%98API%20Management%20Service%20Reader%20Role%E2%80%99%20would%20have%20to%20manually%20provide%20the%20subscription%20key).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20change%20has%20been%20documented%20in%20the%20following%20article%20and%20would%20also%20be%20updated%20in%20APIM%20update%2Frelease%20notes%20shortly.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fgithub.com%252FAzure%252Fazure-sdk-for-net%252Fblob%252Fmaster%252Fsdk%252Fapimanagement%252FMicrosoft.Azure.Management.ApiManagement%252FCHANGELOG.md%26amp%3Bdata%3D02%257C01%257CMithila.Rao%2540microsoft.com%257C72e0b4b9b89b4dd0644f08d84f4113ab%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637346488218599952%26amp%3Bsdata%3Dgf03%252BFa3pK6UtKyu7brzJ77LPNGp%252BPJCydwQsz2q0HE%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure%2Fazure-sdk-for-net%2Fblob%2Fmaster%2Fsdk%2Fapimanagement%2FMicrosoft.Azure.Management.ApiManagement%2FCHANGELOG.md%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20blog%20has%20also%20been%20updated%20to%20reflect%20this%20new%20change.%3C%2FP%3E%0A%3CP%3EThank%20you!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1560571%22%20slang%3D%22en-US%22%3EUsage%20of%20Custom%20RBAC%20roles%20in%20Azure%20API%20Management%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1560571%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3EOverview%20of%20Built-In%20RBAC%20roles%20in%20Azure%20API%20Management%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EA%3C%2FFONT%3Ezure%20API%20Management%20relies%20on%20Azure%20Role-Based%20Access%20Control%20(RBAC)%20to%20enable%20fine-grained%20access%20management%20for%20API%20Management%20services%20and%20entities%20(for%20example%2C%20APIs%20and%20policies).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EReference%20Article%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fapi-management-role-based-access-control%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fapi-management-role-based-access-control%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20highlighted%20in%20the%20above%20article%2C%20Azure%20APIM%20provides%20a%20set%20of%20built-in%20RBAC%20roles%20for%20managing%20access%20to%20APIM%20services.%20These%20roles%20can%20be%20assigned%20at%20different%20scopes%2C%20which%20includes%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ESubscription%20Level%3C%2FLI%3E%0A%3CLI%3EResource%20Group%20Level%3C%2FLI%3E%0A%3CLI%3EIndividual%20APIM%20service%20level%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20following%20table%20provides%20a%20brief%20description%20of%20the%20built-in%20roles%20currently%20offered%20by%20Azure%20APIM.%20These%20roles%20can%20be%20assigned%20via%20Azure%20portal%20or%20other%20tools%2C%20including%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Frole-assignments-powershell%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%26nbsp%3BPowerShell%3C%2FA%3E%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Frole-assignments-cli%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20CLI%3C%2FA%3E%2C%20and%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Frole-assignments-rest%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EREST%20API%3C%2FA%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-center%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22APIM%20Built%20InRoles.PNG%22%20style%3D%22width%3A%20857px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F209628iB0F44184709F7CBD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22APIM%20Built%20InRoles.PNG%22%20alt%3D%22APIM%20Built%20InRoles.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3ECustom%20RBAC%20roles%20in%20Azure%20APIM%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20the%20default%20built-in%20roles%20do%20not%20meet%20specific%20user%20requirements%2C%20you%20can%20create%20custom%20RBAC%20roles%20for%20providing%20a%20more%20granular%20access%20to%20either%20APIM%20services%20or%20any%20of%20their%20sub-components.%3C%2FP%3E%0A%3CP%3ECustom%20Roles%20in%20Azure%20RBAC%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhile%20creating%20a%20custom%20RBAC%20role%2C%20it%20is%20recommended%20to%20follow%20the%20below%20approach%20in%20order%20to%20avoid%20any%20complexities%20or%20discrepancies%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EStart%20with%20one%20of%20the%20built-in%20roles.%3C%2FLI%3E%0A%3CLI%3EEdit%20the%20attributes%20to%20add%20%3CSTRONG%3EActions%3C%2FSTRONG%3E%2C%20%3CSTRONG%3ENotActions%3C%2FSTRONG%3E%2C%20or%20%3CSTRONG%3EAssignableScopes%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3CLI%3ESave%20the%20changes%20as%20a%20new%20role.%3C%2FLI%3E%0A%3CLI%3EAssign%20the%20new%20role%20to%20the%20APIM%20services%20or%20APIM%20components%20(such%20as%20APIs%2C%20policies%2C%20et%20cetera).%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20ARM%20(Azure%20Resource%20Manager)%20Resource%20Provider%20Operations%26nbsp%3Barticle%20contains%20the%20list%20of%20permissions%20that%20can%20be%20granted%20on%20APIM%20level.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fresource-provider-operations%23microsoftapimanagement%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fresource-provider-operations%23microsoftapimanagement%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%20us%20consider%20a%20few%20scenarios%20where%20we%20envision%20the%20usage%20of%20custom%20RBAC%20roles%20to%20enable%20fine-tuned%20access%20to%20APIM%20services%20or%20their%20components.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3EScenario%201%3A%20Deny%20users%20from%20deleting%20APIM%20services%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3ERBAC%20roles%20that%20enable%20having%20complete%20%3CSTRONG%3Ewrite%3C%2FSTRONG%3E%20access%20to%20APIM%20services%20(such%20as%20API%20Management%20Service%20Contributor%20role)%20have%20provision%20for%20performing%20all%20management%20operations%20on%20an%20APIM%20service.%3C%2FP%3E%0A%3CP%3ETo%20avoid%20intentional%2Funintentional%20deletion%20of%20APIM%20services%20by%20any%20user%20having%20write%20access%20other%20than%20the%20APIM%20Administrator%2C%20you%20can%20create%20the%20below%20custom%20RBAC%20role%20for%20denying%20the%20operation%20%3CSTRONG%3EMicrosoft.ApiManagement%2Fservice%2Fdelete%3C%2FSTRONG%3E%20to%20users.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20example%2C%20let%20us%20use%20the%20Azure%20Portal%20for%20modifying%20the%20built-in%20RBAC%20role%20%3CSTRONG%3EContributor%20%3C%2FSTRONG%3Eand%20create%20a%20custom%20role%20for%20denying%20APIM%20service%20deletion%20action%20for%20all%20services%20under%20a%20particular%20Azure%20subscription.%20This%20custom%20role%20would%20allow%20users%20to%20perform%20all%20default%20owner%20operations%20except%20deleting%20APIM%20services%20in%20the%20subscription.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EStep%201%3A%3C%2FP%3E%0A%3CP%3EManeuver%20to%20the%20%3CSTRONG%3EAccess%20Control%20(IAM)%3C%2FSTRONG%3E%20blade%20of%20a%20sample%20APIM%20service%20on%20the%20Azure%20Portal%20and%20click%20on%20the%20%3CSTRONG%3ERoles%3C%2FSTRONG%3E%20tab.%20This%20would%20display%20the%20list%20of%20roles%20that%20are%20available%20for%20assignment.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ss1.PNG%22%20style%3D%22width%3A%20853px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F209629iE3B130321FFDA29A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22ss1.PNG%22%20alt%3D%22ss1.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EStep%202%3A%3C%2FP%3E%0A%3CP%3ESearch%20for%20the%20role%20you%20wish%20to%20clone%20(APIM%20Service%20Contributor%20in%20this%20case).%20At%20the%20end%20of%20the%20row%2C%20click%20the%20ellipsis%20(%3CSTRONG%3E...%3C%2FSTRONG%3E)%20and%20then%20click%26nbsp%3B%3CSTRONG%3EClone%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ss2.PNG%22%20style%3D%22width%3A%20855px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F209630i7E9697DD3E983FE4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22ss2.PNG%22%20alt%3D%22ss2.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EStep%203%3A%20Configure%20the%3CSTRONG%3E%20Basics%3C%2FSTRONG%3E%20section%20as%20follows%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22ss3.PNG%22%20style%3D%22width%3A%20857px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F209633i6CB8F0D58858DD92%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22ss3.PNG%22%20alt%3D%22ss3.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EStep%204%3A%20Configure%20the%3CSTRONG%3E%20Permissions%3C%2FSTRONG%3E%20section.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3ERetain%20the%20default%20permissions%20listed%20for%20this%20role.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EClick%20on%20%3CSTRONG%3E%2BExclude%20Permissions%3C%2FSTRONG%3E%20and%20search%20for%20%3CSTRONG%3EMicrosoft%20API%20Management%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22ss4.PNG%22%20style%3D%22width%3A%20853px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F209634iE2A3DABA90E6E508%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22ss4.PNG%22%20alt%3D%22ss4.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EUnder%20%3CSTRONG%3ENot%20Actions%3C%2FSTRONG%3E%2C%20select%20the%20permission%20%E2%80%98%3CSTRONG%3EDelete%3A%20Delete%20API%20Management%20Service%20instance%E2%80%99%3C%2FSTRONG%3E%20under%20%3CSTRONG%3EMicrosoft.ApiManagement%2Fservice%3C%2FSTRONG%3E%20on%20the%20succeeding%20Permissions%20page%20and%20click%20the%20%3CSTRONG%3EAdd%3C%2FSTRONG%3E%20button.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22ss5.PNG%22%20style%3D%22width%3A%20853px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F209635i7F2C84EA8757B940%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22ss5.PNG%22%20alt%3D%22ss5.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22ss6.PNG%22%20style%3D%22width%3A%20854px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F209637i6527C86A6FE6B1EB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22ss6.PNG%22%20alt%3D%22ss6.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EStep%205%3A%20Configure%20the%20%3CSTRONG%3EAssignable%20Scopes%3C%2FSTRONG%3E%20section.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EDelete%20the%20existing%20resource%20level%20scope.%20Click%20on%20%3CSTRONG%3E%2BAdd%20Assignable%20Scopes%3C%2FSTRONG%3E%20and%20set%20the%20scope%20to%20Subscription%20level.%20Click%20%3CSTRONG%3EAdd%3C%2FSTRONG%3E.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22ss7.PNG%22%20style%3D%22width%3A%20854px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F209638iC7A1ECB1A37F39C9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22ss7.PNG%22%20alt%3D%22ss7.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000080%22%3E%3CSTRONG%3ENOTE%3A%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CFONT%20color%3D%22%23333399%22%3EEach%20Azure%20Active%20Directory%20can%20only%20have%20a%20maximum%20of%205000%20custom%20roles.%26nbsp%3B%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CFONT%20color%3D%22%23333399%22%3EHence%2C%20for%20a%20custom%20role%20where%20the%20assignable%20scope%20is%20configured%20to%20be%20at%20resource%20level%2C%20you%20could%20consider%20replacing%20it%20with%20a%20subscription%20or%20resource%20group%20level%20scope%20to%20prevent%20exhausting%20your%20custom%20role%20limit.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CFONT%20style%3D%22font-family%3A%20inherit%3B%22%20color%3D%22%23333399%22%3EConstraints%20associated%20with%20custom%20roles%20can%20be%20found%20documented%20in%20the%20below%20article%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CA%20style%3D%22font-family%3A%20inherit%3B%20font-size%3A%20medium%3B%20background-color%3A%20%23ffffff%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles%23custom-role-limits%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles%23custom-role-limits%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EStep%206%3A%20In%20the%20%3CSTRONG%3EJSON%3C%2FSTRONG%3E%20section%2C%20you%20could%20also%20%3CSTRONG%3EDownload%3C%2FSTRONG%3E%20your%20custom%20RBAC%20role%20in%20JSON%20format%20for%20future%20usage%20or%20reference.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22remove%20sub.png%22%20style%3D%22width%3A%20854px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F209656iC1D6401A6D012FBB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22remove%20sub.png%22%20alt%3D%22remove%20sub.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EStep%207%3A%20Review%20the%20custom%20RBAC%20role%20details%20in%20the%20%3CSTRONG%3EReview%20%2B%20Create%3C%2FSTRONG%3E%20section%20and%20click%20on%20%3CSTRONG%3ECreate%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3EIt%20may%20take%20a%20few%20minutes%20for%20the%20custom%20role%20to%20be%20created%20and%20displayed%20under%20the%20list%20of%20available%20roles.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20scenario%2C%20the%20newly%20created%20custom%20role%20would%20be%20available%20for%20assignment%20under%20the%20%3CSTRONG%3ERoles%3C%2FSTRONG%3E%20section%20on%20the%20subscription%E2%80%99s%20%3CSTRONG%3EAccess%20Control%20(IAM)%20blade%3C%2FSTRONG%3E%20since%20the%20assignable%20scope%20was%20set%20at%20subscription%20level%20during%20creation.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%20color%3D%22%23000080%22%3E%3CSTRONG%3ENOTE%3A%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%20color%3D%22%23333399%22%3EPost%20creation%2C%20custom%20roles%20appear%20on%20the%20Azure%20portal%20with%20an%20orange%20resource%20icon%20(Built-in%20roles%20appear%20with%20blue%20icons).%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%20color%3D%22%23333399%22%3ECustom%20Roles%20would%20be%20available%20for%20assignment%20at%20the%20respective%20subscription%2C%20resource%20group%20or%20resource%20access%20control%20blade%20based%20on%20the%20assignable%20scope%20that%20has%20been%20configured%20during%20creation%20of%20the%20role.%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EStep%208%3A%20Assign%20this%20custom%20role%20to%20a%20user.%20Any%20user%20having%20this%20role%20would%20be%20able%20to%20perform%20all%20the%20operations%20that%20are%20offered%20by%20default%20by%20the%20%3CSTRONG%3EAPIM%20Service%20Contributor%3C%2FSTRONG%3E%20role%20except%20deleting%20APIM%20services%20in%20the%20subscription.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22assign.PNG%22%20style%3D%22width%3A%20855px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F209642i2488A3465F9721D8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22assign.PNG%22%20alt%3D%22assign.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditormithilarao_3%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3EScenario%202%3A%20Deny%20users%20having%20Reader%20access%20from%20reading%20Product%20subscription%20keys%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3ELet%20us%20consider%20the%20built-in%20APIM%20RBAC%20role%20'API%20Management%20Service%20Reader%E2%80%99%20role%20for%20this%20scenario.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EUsers%20often%20have%20a%20misconception%20that%20only%20the%20APIM%20Administrators%20would%20be%20able%20to%20view%20the%20Product%20subscription%20keys%20on%20the%20Azure%20Portal.%20However%2C%20that%20is%20not%20the%20case.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20ability%20to%20read%20subscription%20keys%20from%20products%20(an%20action%20which%20is%20defined%20as%20%3CSTRONG%3EMicrosoft.ApiManagement%2Fservice%2Fproducts%2Fsubscriptions%2Fread%3C%2FSTRONG%3E)%20is%20allowed%20by%20default%20for%20users%20having%20the%20'API%20Management%20Service%20Reader%20Role'.%20Same%20is%20the%20case%20for%20navigating%20to%20the%20keys%20via%20APIs%2Fsubscriptions.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EHence%2C%20as%20a%20workaround%2C%20you%20can%20create%20a%20custom%20RBAC%20role%20in%20order%20to%20block%20the%20%3CSTRONG%3Esubscription%20keys%20-%20read%3C%2FSTRONG%3E%20action.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Change.PNG%22%20style%3D%22width%3A%20873px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F216542i283E30EE1CDAA7D3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Change.PNG%22%20alt%3D%22Change.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%20color%3D%22%23000080%22%3E%3CSTRONG%3ENOTE%3A%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%20color%3D%22%23333399%22%3EThe%20action%20%3CSTRONG%3EMicrosoft.ApiManagement%2Fservice%2Fusers%2Fkeys%2Fread%3C%2FSTRONG%3E%20does%20not%20correspond%20to%20reading%20subscription%20keys.%20The%202%20actions%20are%20completely%20different.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%20color%3D%22%23333399%22%3EEvery%20user%20has%20two%20%22secrets%22%2C%20a%20primary%20and%20a%20secondary.%20These%20secrets%20are%20used%20to%20generate%20an%20encrypted%20SSO%20token%20that%20users%20can%20use%20to%20access%20the%20developer%20portal.%20These%20keys%20are%20not%20related%20to%20the%20subscription%20keys%20that%20users%20use%20to%20call%20the%20APIs.%20The%20%3CSTRONG%3E%2Fservice%2Fusers%2Fkeys%2Fread%3C%2FSTRONG%3E%20permission%20corresponds%20to%20the%20ability%20to%20read%20the%20user%20secrets%2C%20whereas%20the%20%3CSTRONG%3E%2Fservice%2Fproducts%2Fsubscriptions%2Fread%3C%2FSTRONG%3E%20permission%20corresponds%20to%20reading%20subscription%20keys%20under%20products%2C%20which%20is%20allowed%20by%20default%20under%20the%20%E2%80%98API%20Management%20Service%20Reader%E2%80%99%20role.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%20color%3D%22%23333399%22%3EAdditionally%2C%20the%20%3CSTRONG%3EMicrosoft.ApiManagement%2Fservice%2Fusers%2Fsubscriptions%2Fread%3C%2FSTRONG%3E%20permission%20corresponds%20to%20the%20ability%20to%20read%20subscriptions%20associated%20with%20users%20via%20the%20%22Users%22%20blade%20on%20the%20Portal.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EHere%2C%20we%20are%20creating%20and%20assigning%20a%20custom%20RBAC%20role%20using%20PowerShell%20for%20denying%20users%20having%20Read%20access%20over%20the%20APIM%20service%20from%20reading%20the%20subscription%20keys.%20Basically%2C%20this%20role%20denies%20users%20from%20performing%20the%20operation%20%3CSTRONG%3EMicrosoft.ApiManagement%2Fservice%2Fproducts%2Fsubscriptions%2Fread%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20sample%20PowerShell%20script%20is%20as%20below%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24role%20%3D%20Get-AzRoleDefinition%20%22API%20Management%20Service%20Reader%20Role%22%0A%24role.Id%20%3D%20%24null%0A%24role.Name%20%3D%20'Deny%20reading%20subscription%20keys'%0A%24role.Description%20%3D%20'Denies%20users%20from%20reading%20product%20subscription%20keys'%0A%24role.NotActions.Clear()%0A%24role.NotActions.Add('Microsoft.ApiManagement%2Fservice%2Fproducts%2Fsubscriptions%2Fread')%0A%24role.AssignableScopes.Clear()%0A%24role.AssignableScopes.Add('%2Fsubscriptions%2F%3CSUBSCRIPTION%20id%3D%22%22%3E%2FresourceGroups%2F%3CRESOURCE%20group%3D%22%22%20name%3D%22%22%3E%2Fproviders%2FMicrosoft.ApiManagement%2Fservice%2F%3CSERVICE%20name%3D%22%22%3E')%0ANew-AzRoleDefinition%20-Role%20%24role%0ANew-AzRoleAssignment%20-ObjectId%20%3COBJECT%20id%3D%22%22%20of%3D%22%22%20the%3D%22%22%20user%3D%22%22%20account%3D%22%22%3E%20-RoleDefinitionName%20'Deny%20reading%20subscription%20keys'%20-Scope%20'%2Fsubscriptions%2F%3CSUBSCRIPTION%20id%3D%22%22%3E%2FresourceGroups%2F%3CRESOURCE%20group%3D%22%22%20name%3D%22%22%3E%2Fproviders%2FMicrosoft.ApiManagement%2Fservice%2F%3CSERVICE%20name%3D%22%22%3E'%20%0A%3C%2FSERVICE%3E%3C%2FRESOURCE%3E%3C%2FSUBSCRIPTION%3E%3C%2FOBJECT%3E%3C%2FSERVICE%3E%3C%2FRESOURCE%3E%3C%2FSUBSCRIPTION%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3EKnown%20Limitations%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3ECurrent%20design%20does%20not%20allow%20RBAC%20permissions%20to%20be%20controlled%20at%20Product%20level%20for%20API%20creation%2Fdeletion.%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EFor%20example%2C%20consider%20a%20scenario%20where%20users%20on%20the%20Azure%20Portal%20should%20have%20read%20and%20write%20access%20only%20over%20APIs%20that%20are%20associated%20with%20a%20particular%20Product.%20For%20this%2C%20you%20can%20configure%20an%20RBAC%20role%20where%20the%20assignable%20scope%20has%20been%20set%20at%20%E2%80%9CProduct%E2%80%9D%20level%20and%20add%20the%20desired%20%3CSTRONG%3EActions%3C%2FSTRONG%3E%20and%20%3CSTRONG%3ENotActions%3C%2FSTRONG%3E.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3ENow%2C%20even%20if%20you%20add%20the%20permission%20%3CEM%3E%E2%80%9CMicrosoft.ApiManagement%2Fservice%2Fapis%2F*%E2%80%9D%3C%2FEM%3E%20at%20product%20scope%2C%20when%20the%20user%20who%20is%20assigned%20this%20role%20attempts%20creating%20a%20new%20API%20inside%20this%20Product%2C%20the%20operation%20would%20still%20fail.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EIf%20a%20user%20needs%20to%20create%20a%20new%20API%20in%20the%20service%20(irrespective%20of%20whether%20it%20is%20inside%20the%20same%20Product)%2C%20they%20should%20be%20able%20to%20read%20all%20APIs%20in%20the%20service%20and%20have%20write%20permissions%20granted%20at%20the%20APIM%20service%20scope%20instead%20of%20Product%20scope.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThis%20is%20because%2C%20when%20a%20user%20attempts%20to%20create%20a%20new%20API%20or%20add%20a%20new%20version%2Frevision%20for%20an%20existing%20API%2C%20there%20is%20a%20validation%20check%20that%20happens%20in%20the%20background%20to%20verify%20if%20there%20is%20any%20other%20API%20in%20the%20service%20which%20is%20using%20the%20same%20path%20that%20the%20user%20is%20attempting%20to%20create.%20If%20the%20user%20performing%20this%20operation%20does%20not%20have%20permissions%20to%20read%20all%20APIs%20in%20the%20service%2C%20the%20operation%20would%20fail.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3E%3CFONT%20size%3D%223%22%3EAPI%20Revisions%20and%20API%20Versions%20cannot%20be%20created%20by%20users%20having%20permissions%20over%20individual%20API(s)%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20APIM%20Administrator%20may%20want%20to%20allow%20certain%20users%20to%20manage%20particular%20APIs%20without%20having%20the%20ability%20to%20create%20new%20APIs%20or%20read%2Faccess%20other%20APIs.%20If%20this%20user%20is%20assigned%20permissions%20only%20for%20an%20individual%20API%2C%26nbsp%3B%3C%2FFONT%3Ethey%20would%20be%20able%20to%20perform%20all%20operations%20on%20this%20API%20except%20being%20able%20to%20create%20revisions%20and%20versions%20for%20the%20API.%3C%2FP%3E%0A%3CP%3ECreating%20API%20versions%2Frevisions%20is%20equivalent%20to%20creating%20a%20new%20API%2C%20which%20by%20design%2C%20has%20to%20undergo%20a%20validation%20check%20as%20highlighted%20in%20the%20previous%20limitation.%3C%2FP%3E%0A%3CP%3EThis%20is%20a%20design%20limitation%20which%20can%20be%20overcome%20by%20assigning%20the%20user%20appropriate%20RBAC%20permission(s)%20to%20read%20all%20APIs%20in%20the%20service%20and%20create%20new%20APIs%20in%20the%20service.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3EPermissions%20to%20view%20APIM%20Diagnostics%20Logs%20cannot%20be%20configured%20at%20APIM%20scope.%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EFor%20example%2C%20if%20user%20has%20configured%20streaming%20of%20APIM%20Diagnostic%20Logs%20to%20a%20Log%20Analytics%20Workspace%20and%20wishes%20to%20create%20a%20custom%20RBAC%20role%20only%20for%20viewing%20these%20diagnostic%20logs%2C%20it%20wouldn%E2%80%99t%20be%20possible%20to%20configure%20this%20role%20at%20the%20APIM%20scope.%20Since%20the%20log%20destination%20is%20Log%20Analytics%2C%20the%20permission%20has%20to%20be%20configured%20at%20the%20Log%20Analytics%20scope.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThe%20APIM%20ARM%20operation%20%3CEM%3E%E2%80%9CMicrosoft.ApiManagement%2Fservice%2Fapis%2Fdiagnostics%2Fread%E2%80%9D%3C%2FEM%3E%20only%20controls%20access%20to%20the%20diagnostic%20configuration%20for%20the%20APIM%20service%20and%20not%20to%20the%20diagnostic%20telemetry%20that%20APIM%20streams%20to%20external%20resources%20such%20as%20Log%20Analytics%2FApplication%20Insights%2C%20et%20cetera.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3EPreventing%20users%20from%20accessing%20the%20Test%20Console%20for%20APIs%20on%20the%20Azure%20Portal%20cannot%20be%20achieved%20with%20a%20straight-forward%20approach.%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EThis%20is%20because%20there%20are%20no%20APIM%20ARM%20operations%20that%20support%20actions%20corresponding%20to%20%3CEM%3E%E2%80%9CMicrosoft.ApiManagement%2Fservice%2Fapis%2Foperations%2Ftest%E2%80%9D.%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EHowever%2C%20this%20limitation%20can%20be%20overcome%20if%20the%20API%20is%20protected%20by%20a%20subscription%20key.%20When%20the%20permission%20%3CEM%3E%E2%80%9CMicrosoft.ApiManagement%2Fservice%2Fsubscriptions%2Fread%E2%80%9D%3C%2FEM%3E%20is%20denied%20to%20a%20user%2C%20the%20user%20cannot%20test%20an%20API%20protected%20by%20a%20subscription%20key%20since%20they%20wouldn%E2%80%99t%20be%20able%20to%20retrieve%20the%20subscription%20key%20required%20for%20testing%20the%20API%20operation.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EA%20JSON%20sample%20for%20creating%20this%20custom%20role%20can%20be%20found%20attached%20below%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%20%20%22properties%22%3A%20%7B%0A%20%20%20%20%22roleName%22%3A%20%22Deny%20Testing%20APIs%22%2C%0A%20%20%20%20%22description%22%3A%20%22Deny%20Testing%20APIs%22%2C%0A%20%20%20%20%22assignableScopes%22%3A%20%5B%0A%20%20%20%20%20%20%22%2Fsubscriptions%2F%3CSUBSCRIPTION%20id%3D%22%22%3E%2FresourceGroups%2F%3CRESOURCE%20group%3D%22%22%20name%3D%22%22%3E%2Fproviders%2FMicrosoft.ApiManagement%2Fservice%2F%3CSERVICE%20name%3D%22%22%3E%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22permissions%22%3A%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22actions%22%3A%20%5B%5D%2C%0A%20%20%20%20%20%20%20%20%22notActions%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%22Microsoft.ApiManagement%2Fservice%2Fsubscriptions%2Fread%22%0A%20%20%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%20%20%22dataActions%22%3A%20%5B%5D%2C%0A%20%20%20%20%20%20%20%20%22notDataActions%22%3A%20%5B%5D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%5D%0A%20%20%7D%0A%7D%0A%3C%2FSERVICE%3E%3C%2FRESOURCE%3E%3C%2FSUBSCRIPTION%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3EAPPENDIX%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EOverview%20of%20Access%20Management%20in%20Azure%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Foverview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Foverview%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EOverview%20of%20Role-Based%20Access%20Control%20(RBAC)%20on%20Azure%20Portal%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Frole-assignments-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Frole-assignments-portal%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EOverview%20of%20Azure%20Custom%20RBAC%20roles%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ETutorials%20for%20Creating%20Custom%20RBAC%20Roles%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3Ea)%20Azure%20Portal%20Tutorial%20-%20%3CA%20style%3D%22font-family%3A%20inherit%3B%20background-color%3A%20%23ffffff%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles-portal%3C%2FA%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3Eb)%20PowerShell%20Tutorial%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Ftutorial-custom-role-powershell%23create-a-custom-role%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Ftutorial-custom-role-powershell%23create-a-custom-role%3C%2FA%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3Ec)%20Azure%20CLI%20Tutorial%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Ftutorial-custom-role-cli%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Ftutorial-custom-role-cli%3C%2FA%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3Ed)%20REST%20API%20Tutorial%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles-rest%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles-rest%3C%2FA%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3Ee)%20ARM%20Template%20Tutorial%20and%20Sample%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles-template%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fcustom-roles-template%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1560571%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22LOGO2.PNG%22%20style%3D%22width%3A%20543px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F209632iC99898FD87232B9B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22LOGO2.PNG%22%20alt%3D%22LOGO2.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EA%3C%2FFONT%3Ezure%20API%20Management%20relies%20on%20Azure%20Role-Based%20Access%20Control%20(RBAC)%20to%20enable%20fine-grained%20access%20management%20for%20API%20Management%20services%20and%20entities%20(for%20example%2C%20APIs%20and%20policies).%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1560571%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAPI%20Management%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAPIM%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAPIs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Earm%20template%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20API%20Management%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20APIM%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eazure%20portal%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ECustom%20Roles%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EJson%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ERBAC%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ERBAC%20Roles%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ERole-based%20Access%20Control%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ERoles%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

 

Overview of Built-In RBAC roles in Azure API Management

 

Azure API Management relies on Azure Role-Based Access Control (RBAC) to enable fine-grained access management for API Management services and entities (for example, APIs and policies).

 

Reference Article: https://docs.microsoft.com/en-us/azure/api-management/api-management-role-based-access-control

 

As highlighted in the above article, Azure APIM provides a set of built-in RBAC roles for managing access to APIM services. These roles can be assigned at different scopes, which includes

  • Subscription Level
  • Resource Group Level
  • Individual APIM service level

 

The following table provides a brief description of the built-in roles currently offered by Azure APIM. These roles can be assigned via Azure portal or other tools, including Azure PowerShellAzure CLI, and REST API

 

APIM Built InRoles.PNG

 

 

 

Custom RBAC roles in Azure APIM

 

If the default built-in roles do not meet specific user requirements, you can create custom RBAC roles for providing a more granular access to either APIM services or any of their sub-components.

Custom Roles in Azure RBAC: https://docs.microsoft.com/en-us/azure/role-based-access-control/custom-roles

 

While creating a custom RBAC role, it is recommended to follow the below approach in order to avoid any complexities or discrepancies:

  • Start with one of the built-in roles.
  • Edit the attributes to add Actions, NotActions, or AssignableScopes.
  • Save the changes as a new role.
  • Assign the new role to the APIM services or APIM components (such as APIs, policies, et cetera).

 

The ARM (Azure Resource Manager) Resource Provider Operations article contains the list of permissions that can be granted on APIM level.

https://docs.microsoft.com/en-us/azure/role-based-access-control/resource-provider-operations#micros...

 

Let us consider a few scenarios where we envision the usage of custom RBAC roles to enable fine-tuned access to APIM services or their components.

 

 

Scenario 1: Deny users from deleting APIM services

 

RBAC roles that enable having complete write access to APIM services (such as API Management Service Contributor role) have provision for performing all management operations on an APIM service.

To avoid intentional/unintentional deletion of APIM services by any user having write access other than the APIM Administrator, you can create the below custom RBAC role for denying the operation Microsoft.ApiManagement/service/delete to users.

 

In this example, let us use the Azure Portal for modifying the built-in RBAC role Contributor and create a custom role for denying APIM service deletion action for all services under a particular Azure subscription. This custom role would allow users to perform all default owner operations except deleting APIM services in the subscription.

 

Step 1:

Maneuver to the Access Control (IAM) blade of a sample APIM service on the Azure Portal and click on the Roles tab. This would display the list of roles that are available for assignment.

 

ss1.PNG

 

Step 2:

Search for the role you wish to clone (APIM Service Contributor in this case). At the end of the row, click the ellipsis (...) and then click Clone

 

ss2.PNG

 

Step 3: Configure the Basics section as follows

 

ss3.PNG

 

 

Step 4: Configure the Permissions section.

 

Retain the default permissions listed for this role.

Click on +Exclude Permissions and search for Microsoft API Management

 

ss4.PNG

 

 

Under Not Actions, select the permission ‘Delete: Delete API Management Service instance’ under Microsoft.ApiManagement/service on the succeeding Permissions page and click the Add button.

 

ss5.PNG

 

 

ss6.PNG

 

 

Step 5: Configure the Assignable Scopes section.

 

Delete the existing resource level scope. Click on +Add Assignable Scopes and set the scope to Subscription level. Click Add.

 

ss7.PNG

 

 

NOTE:

  • Each Azure Active Directory can only have a maximum of 5000 custom roles. 

Hence, for a custom role where the assignable scope is configured to be at resource level, you could consider replacing it with a subscription or resource group level scope to prevent exhausting your custom role limit.

Constraints associated with custom roles can be found documented in the below article:

https://docs.microsoft.com/en-us/azure/role-based-access-control/custom-roles#custom-role-limits

 

 

Step 6: In the JSON section, you could also Download your custom RBAC role in JSON format for future usage or reference.

 

remove sub.png

 

 

Step 7: Review the custom RBAC role details in the Review + Create section and click on Create.

It may take a few minutes for the custom role to be created and displayed under the list of available roles.

 

In this scenario, the newly created custom role would be available for assignment under the Roles section on the subscription’s Access Control (IAM) blade since the assignable scope was set at subscription level during creation.

 

 

NOTE:

  • Post creation, custom roles appear on the Azure portal with an orange resource icon (Built-in roles appear with blue icons).
  • Custom Roles would be available for assignment at the respective subscription, resource group or resource access control blade based on the assignable scope that has been configured during creation of the role.

 

Step 8: Assign this custom role to a user. Any user having this role would be able to perform all the operations that are offered by default by the APIM Service Contributor role except deleting APIM services in the subscription.

 

assign.PNG

 

 

 

Scenario 2: Deny users having Reader access from reading Product subscription keys

 

Let us consider the built-in APIM RBAC role 'API Management Service Reader’ role for this scenario.

Users often have a misconception that only the APIM Administrators would be able to view the Product subscription keys on the Azure Portal. However, that is not the case.

The ability to read subscription keys from products (an action which is defined as Microsoft.ApiManagement/service/products/subscriptions/read) is allowed by default for users having the 'API Management Service Reader Role'. Same is the case for navigating to the keys via APIs/subscriptions.

Hence, as a workaround, you can create a custom RBAC role in order to block the subscription keys - read action.

 

Change.PNG

 

NOTE:

The action Microsoft.ApiManagement/service/users/keys/read does not correspond to reading subscription keys. The 2 actions are completely different.

Every user has two "secrets", a primary and a secondary. These secrets are used to generate an encrypted SSO token that users can use to access the developer portal. These keys are not related to the subscription keys that users use to call the APIs. The /service/users/keys/read permission corresponds to the ability to read the user secrets, whereas the /service/products/subscriptions/read permission corresponds to reading subscription keys under products, which is allowed by default under the ‘API Management Service Reader’ role.

Additionally, the Microsoft.ApiManagement/service/users/subscriptions/read permission corresponds to the ability to read subscriptions associated with users via the "Users" blade on the Portal.

 

Here, we are creating and assigning a custom RBAC role using PowerShell for denying users having Read access over the APIM service from reading the subscription keys. Basically, this role denies users from performing the operation Microsoft.ApiManagement/service/products/subscriptions/read

 

The sample PowerShell script is as below:

 

 

 

$role = Get-AzRoleDefinition "API Management Service Reader Role"
$role.Id = $null
$role.Name = 'Deny reading subscription keys'
$role.Description = 'Denies users from reading product subscription keys'
$role.NotActions.Clear()
$role.NotActions.Add('Microsoft.ApiManagement/service/products/subscriptions/read')
$role.AssignableScopes.Clear()
$role.AssignableScopes.Add('/subscriptions/<subscription ID>/resourceGroups/<resource group name>/providers/Microsoft.ApiManagement/service/<service name>')
New-AzRoleDefinition -Role $role
New-AzRoleAssignment -ObjectId <object ID of the user account> -RoleDefinitionName 'Deny reading subscription keys' -Scope '/subscriptions/<subscription ID>/resourceGroups/<resource group name>/providers/Microsoft.ApiManagement/service/<service name>' 

 

 

 

 

 

 

Known Limitations

 

  • Current design does not allow RBAC permissions to be controlled at Product level for API creation/deletion.

For example, consider a scenario where users on the Azure Portal should have read and write access only over APIs that are associated with a particular Product. For this, you can configure an RBAC role where the assignable scope has been set at “Product” level and add the desired Actions and NotActions.

 

Now, even if you add the permission “Microsoft.ApiManagement/service/apis/*” at product scope, when the user who is assigned this role attempts creating a new API inside this Product, the operation would still fail.

If a user needs to create a new API in the service (irrespective of whether it is inside the same Product), they should be able to read all APIs in the service and have write permissions granted at the APIM service scope instead of Product scope.

 

This is because, when a user attempts to create a new API or add a new version/revision for an existing API, there is a validation check that happens in the background to verify if there is any other API in the service which is using the same path that the user is attempting to create. If the user performing this operation does not have permissions to read all APIs in the service, the operation would fail.

 

 

  • API Revisions and API Versions cannot be created by users having permissions over individual API(s)

The APIM Administrator may want to allow certain users to manage particular APIs without having the ability to create new APIs or read/access other APIs. If this user is assigned permissions only for an individual API, they would be able to perform all operations on this API except being able to create revisions and versions for the API.

Creating API versions/revisions is equivalent to creating a new API, which by design, has to undergo a validation check as highlighted in the previous limitation.

This is a design limitation which can be overcome by assigning the user appropriate RBAC permission(s) to read all APIs in the service and create new APIs in the service.

 

 

  • Permissions to view APIM Diagnostics Logs cannot be configured at APIM scope.

For example, if user has configured streaming of APIM Diagnostic Logs to a Log Analytics Workspace and wishes to create a custom RBAC role only for viewing these diagnostic logs, it wouldn’t be possible to configure this role at the APIM scope. Since the log destination is Log Analytics, the permission has to be configured at the Log Analytics scope.

 

The APIM ARM operation “Microsoft.ApiManagement/service/apis/diagnostics/read” only controls access to the diagnostic configuration for the APIM service and not to the diagnostic telemetry that APIM streams to external resources such as Log Analytics/Application Insights, et cetera.

 

 

  • Preventing users from accessing the Test Console for APIs on the Azure Portal cannot be achieved with a straight-forward approach.

This is because there are no APIM ARM operations that support actions corresponding to “Microsoft.ApiManagement/service/apis/operations/test”.

However, this limitation can be overcome if the API is protected by a subscription key. When the permission “Microsoft.ApiManagement/service/subscriptions/read” is denied to a user, the user cannot test an API protected by a subscription key since they wouldn’t be able to retrieve the subscription key required for testing the API operation.

 

A JSON sample for creating this custom role can be found attached below:

 

 

 

{
  "properties": {
    "roleName": "Deny Testing APIs",
    "description": "Deny Testing APIs",
    "assignableScopes": [
      "/subscriptions/<subscription ID>/resourceGroups/<resource group name>/providers/Microsoft.ApiManagement/service/<service name>"
    ],
    "permissions": [
      {
        "actions": [],
        "notActions": [
          "Microsoft.ApiManagement/service/subscriptions/read"
        ],
        "dataActions": [],
        "notDataActions": []
      }
    ]
  }
}

 

 

 

 

 

 

APPENDIX

 

 

 

 

  • Tutorials for Creating Custom RBAC Roles:

a) Azure Portal Tutorial - https://docs.microsoft.com/en-us/azure/role-based-access-control/custom-roles-portal

b) PowerShell Tutorial - https://docs.microsoft.com/en-us/azure/role-based-access-control/tutorial-custom-role-powershell#cre...

c) Azure CLI Tutorial - https://docs.microsoft.com/en-us/azure/role-based-access-control/tutorial-custom-role-cli

d) REST API Tutorial - https://docs.microsoft.com/en-us/azure/role-based-access-control/custom-roles-rest

e) ARM Template Tutorial and Sample - https://docs.microsoft.com/en-us/azure/role-based-access-control/custom-roles-template

 

 

 

3 Comments

Great blogpost ! Thanks for Sharing with the Community :cool:

Occasional Visitor

Hi 

Looks like something has been changed recently as you mentioned in step 8.

Scenario 2 - https://techcommunity.microsoft.com/t5/azure-paas-developer-blog/usage-of-custom-rbac-roles-in-azure... 

"

The ability to read subscription keys from products (an action which is defined as Microsoft.ApiManagement/service/products/subscriptions/read) is allowed by default for users having the 'API Management Service Reader Role'. Same is the case for navigating to the keys via APIs/subscriptions.

"

The API Management Service Reader Role' use to allow to view the API subscriptions of products , however from august 20 this feature is not available or some updates happend with new developer portal updates .

We had an user in our environment with API Management Service Reader Role' access to APIM and he was able to view the subscription keys .

Now all of sudden without any changes to permission he is not able view the keys and he can not perform the API call test from the APIM portal.

 

Would you be able to confirm , if there any changes happend recently from MS . which could have triggered API subscription key access.

 

 

Microsoft

Hi @Jagan CR ,

 

Thanks for your comment!

 

Yes, this has been a recent design change. The Azure Portal has been upgraded to use API Version 2019-12-01.

With this change, APIM users having the 'API Management Service Reader Role' would no longer be able to read subscription keys. Neither would the subscription keys be automatically added while performing sample API calls from within the Test console of the APIM service for users having this role (Users with the ‘API Management Service Reader Role’ would have to manually provide the subscription key).

 

This change has been documented in the following article and would also be updated in APIM update/release notes shortly.

https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/apimanagement/Microsoft.Azure.Management....

 

The blog has also been updated to reflect this new change.

Thank you!