code: public static String relativePathFromResourceId(String id) {
          if (id == null) {
              return null;
          }
          String[] paths = id.split("/providers/" + resourceProviderFromResourceId(id) + "/", 2);
          if (paths.length == 1) {
              return "";
          } else {
              return paths[1];
          }
      }
docs: Extract the relative path to the current resource provider.
  E.g. subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Foo/foos/foo1 will return foos/foo1.
  
  @param id the id of the resource
  @return the relative path